package net.dipper.tankwar.game.helper;

/*消息类*/
public class Message {
	public static final int HEALTH_DECREASE = 0;
	public static final int GAME_RESULT = 1;
	
	private int messageType;	//消息类型
	private int x;	//消息位置横坐标
	private int y;	//消息位置纵坐标
	private int lifeTime;	//消息生命期
	private String content;	//消息内容
	
	public Message(int messageType, int x, int y, int lifeTime){
		this.messageType = messageType;
		this.x = x;
		this.y = y;
		this.lifeTime = lifeTime;
	}
	
	public Message(int messageType, int x, int y, int lifeTime, String content) {
		this.messageType = messageType;
		this.x = x;
		this.y = y;
		this.content = content;
	}

	//获取消息类型
	public int getMessageType(){
		return this.messageType;
	}

	//获取消息位置横坐标
	public int getX() {
		return this.x;
	}
	
	//获取消息位置纵坐标
	public int getY(){
		return this.y;
	}
	
	//减少生命值
	public int stepLifeTime(){
		this.lifeTime -= 1;
		return this.lifeTime;
	}
	
	//获取生命值
	public int getLifeTime(){
		return this.lifeTime;
	}

	public String getContent() {
		return this.content;
	}
}
